package com.jic.veteran.portal.controller;

import com.google.common.collect.Maps;
import com.jic.veteran.common.api.CommonResult;
import com.jic.veteran.model.CmsArticleInfo;
import com.jic.veteran.portal.domain.CmsArticleQueryParam;
import com.jic.veteran.portal.service.ArticleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 文章管理Controller
 * @author lsw1991abc@gmail.com
 * @date 2021/6/29 09:47
 */
@RestController
@Api(tags = "ArticleController")
@RequestMapping("/article")
public class ArticleController {
  @Autowired
  private ArticleService articleService;

//  @ApiOperation("查询文章列表")
//  @RequestMapping(value = "/list", method = RequestMethod.GET)
//  public CommonResult<Map<String, List<CmsArticleInfo>>> list(
//      CmsArticleQueryParam queryParam) {
//    List<CmsArticleInfo> articleInfoList = articleService.list(queryParam);
//    Map<String, List<CmsArticleInfo>> map = Maps.newHashMapWithExpectedSize(3);
//    map.put("list", articleInfoList);
//    return CommonResult.success(map);
//  }
//
//  @ApiOperation("获取文章详情")
//  @RequestMapping(value = "/detail/{id}", method = RequestMethod.GET)
//  @ResponseBody
//  public CommonResult<CmsArticleInfo> detail(@PathVariable Long id) {
//    CmsArticleInfo articleInfo = articleService.detail(id);
//    return CommonResult.success(articleInfo);
//  }

}
